var t = getApp();

Page({
    data: {
        index: 0,
        inputLen: 0,
        maxLen: 50,
        content: "",
        error: !1,
        textValue: ''
    },
    oninput: function (t) {
        var a = t.detail.value;
        this.data.textValue = a;
        this.setData({
            inputLen: a.length
        }), a.length > this.data.maxLen ? this.setData({
            error: !0
        }) : this.setData({
            error: !1
        });
    },
    onconfirm: function (a) {
        var e = a.detail.value || this.data.textValue;
        if (e !== '') {
            t.globalData.title = e, wx.navigateBack();
        } else {
            wx.showToast({
                title: '输入内容不能为空',
                icon: 'none'
            })
        }
    },
    onLoad: function (a) {
        if (a.title !== 'undefined'){
            t.globalData.title = a.title
        }
        if (t.globalData.title){
            this.setData({
                title: t.globalData.title
            })
        }
    },
    onReady: function () {
        wx.setNavigationBarTitle({
            title: "修改标题"
        });
    },
    onShow: function () { },
    onHide: function () { },
    onUnload: function () { },
    onPullDownRefresh: function () { },
    onReachBottom: function () { }
});